import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 读入一个字符串，输出字符串中最长的连续数字串
 */
public class Test1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        //最长数字串的起始位置
        int max = 0;
        //最长数字串长度
        int maxCount = 0;
        //遇到数字时的位置
        int tmp = 0;
        //tmp起始的数字串的长度
        int tmpCount = 0;
        int i = 0;
        while(i < s.length()) {
            if(s.charAt(i) >= '0' && s.charAt(i) <= '9') {
                tmp = i++;
                tmpCount = 1;
                while(i < s.length() && s.charAt(i) >= '0' && s.charAt(i) <= '9') {
                    tmpCount++;
                    i++;
                }
            }
            if(tmpCount > maxCount) {
                maxCount = tmpCount;
                max = tmp;
                tmpCount = 0;
            }
            i++;
        }
        StringBuilder stringBuilder = new StringBuilder();
        for(i = max; i < max + maxCount; i++) {
            stringBuilder.append(s.charAt(i));
        }
        System.out.println(stringBuilder.toString());
    }
}
